package com.yyfax.pay.config.data.dao;

import java.util.List;

import com.yyfax.pay.config.model.po.MerchantPaymentPO;

/**
 * 商户支付通道信息
 * 
 * @author changxd
 * @date 2017-04-13
 * @since 1.0.0
 */
public interface MerchantPaymentDao {
	/**
	 * 新增商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @param config
	 * @return
	 */
	public int insert(MerchantPaymentPO config) throws Exception;

	/**
	 * 更新商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @param config
	 * @return
	 */
	public int update(MerchantPaymentPO config) throws Exception;

	/**
	 * 按ID查询商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @param id
	 * @return
	 */
	public MerchantPaymentPO selectById(int id) throws Exception;

	/**
	 * 查询全部的商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @return
	 */
	public List<MerchantPaymentPO> selectForList() throws Exception;

	/**
	 * 根据四要素查询商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @param merchantCode
	 * @param paymentCode
	 * @param payType
	 * @param payMode
	 * @return
	 */
	public MerchantPaymentPO selectMerchantPayment(String merchantCode, String paymentCode, String payType, String payMode) throws Exception;

	/**
	 * 根据四要素查询商户支付通道信息
	 * 
	 * @author changxd
	 * @date 2017-04-13
	 * @since 1.0.0
	 * @param payMerchantId
	 * @param paymentCode
	 * @param payType
	 * @param payMode
	 * @return
	 */
	public MerchantPaymentPO selectMerchantPaymentId(String payMerchantId, String paymentCode, String payType, String payMode) throws Exception;

	/**
	 * 默认查询商户支付通道信息返回优先级最高的一条
	 * 
	 * @author changxd
	 * @date 2017-04-14
	 * @since 1.0.0
	 * @param merchantCode
	 * @param payType
	 * @param payMode
	 * @return
	 */
	public MerchantPaymentPO selectDefaultByMerchantCode(String merchantCode, String payType, String payMode, String apiType) throws Exception;

	public List<MerchantPaymentPO> selectListByMerchantAndPayType(String merchantCode, String payType);

}
